package com.itheima.utils;

import javax.servlet.http.Cookie;

/*
    根据名称获取指定Cookie
 */
public class CookieUtils {
    public static Cookie findCookieByName(Cookie[] cookies,String cookieName){
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                if (cookieName.equals(cookie.getName())) {
                    return cookie;
                }
            }
        }
        return null;
    }
}
